package com.xinju.mcpjava.config;

import com.xinju.mcpjava.service.McpJavaService;
import org.springframework.ai.tool.ToolCallbackProvider;
import org.springframework.ai.tool.method.MethodToolCallbackProvider;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ToolCallbackProviderConfig {

    @Bean
    public ToolCallbackProvider toolCallbackProvider(McpJavaService mcpJavaService) {
        return MethodToolCallbackProvider.builder()
                .toolObjects(mcpJavaService)
                .build();
    }
}
